home *** CD-ROM | disk | FTP | other *** search
- Path: nana.franken.de!wolfgang
- Date: 10 Mar 1996 22:16:00 +0200
- From: wolfgang@nana.franken.de (Wolfgang Thomas)
- Sender: wolfgang@nana.franken.de (Wolfgang Thomas)
- Newsgroups: comp.lang.c++
- Message-ID: <64cnnJdipZB@nana.franken.de>
- Subject: Watcom C++ pecularities
- X-Newsreader: CrossPoint v3.1 R/B12245
-
- Hello,
-
- I have discovered some strange behaviours with C/C++ 10.0A, which
- I cannot understand. As I am no expert for C++ it might all be
- my fault. Perhaps there are some experienced WATCOM C++ user
- who can help me.
-
- All the following refers to C/C++ 10.0A and the creation of 32 bit
- executables respective DLLs for OS/2.
-
- 1.) The following template class compiles and links fine, if the
- class definition and the main function are in the same module.
- If however main is in a different file then the template
- class compiles fine but ends with a linker error
- "near <int near, int near>::Test::Test (char near*) is an undefined
- reference". Why?
-
- template <class KEY, class INFO>
- class Test
- { public: Test (char* f); };
-
- template <class KEY, class INFO>
- Test<KEY, INFO>::Test (char *f)
- { f++; }
-
- void main ()
- { Test<int, int> a(0); }
-
-
- 2.) The following structure definition within the private section
- of a class definition causes a compiler error "access to private
- member test::A is not allowed". Why?
-
- class test
- { private: struct A
- {
- int a;
- int b;
- };
-
- struct B
- {
- struct A a;
- int c;
- };
- };
-
-
- 3.) How can a class be exported within a DLL? The documentation only
- states that for a function an underscore has to be added. But what
- is the naming convention for member functions?
-
-
- Thanks for any help.
-
- Bye
- Wolfgang
-
-